Re: [PATCH 3/5] net: use virDomainNICModelType{From|To}String functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/14/2013 10:25 PM, John Ferlan wrote:
oops - one more ...

On 01/13/2013 10:34 AM, Guannan Ren wrote:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 661cc0f..a5ce119 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -878,7 +878,7 @@ struct _virDomainActualNetDef {
  struct _virDomainNetDef {
      enum virDomainNetType type;
      virMacAddr mac;
-    char *model;
+    int model;
Should this be?

     enum virDomainNICModel model;

for consistency.



    Some places where we write code like this:
    if ((net->model = virDomainNICModelTypeFromString(model)) < 0)
        ...

If the model is type of enum and compile it with gcc option -Werror=type-limits
    gcc will report like:

error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]

    so we still need int type here.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]